﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.Odbc;

using VPBS.Common;

namespace VPBS.DB2.DAL
{
    public class PortfolioDAL
    {
        /// <summary>
        /// Lay danh sach danh muc chung khoan cua tung tai khoan
        /// </summary>
        /// <param name="AccountNo"></param>
        /// <returns>DataSet Get_PortfolioToday</returns>
        public static DataTable Get_PortfolioToday(string AccountNo)
        {
            try
            {
                string command = "CALL DB2INST1.VPBS_TNPLUS_PORTFOLIO('" + AccountNo + "')";

                DataSet ds = DB2Helper.ExecuteDataSet(ConnectStringHelper.Db2ConnectionString, CommandType.Text,
                                                      command);
                if (ds != null && ds.Tables.Count > 0)
                    return ds.Tables[0];
                return new DataTable();
            }
            catch (Exception ex)
            {
                //Logger.Error(typeof(Get_PortfolioTodayDAL), ex);
                return new DataTable();
            }
        }
    }
}
